﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Ccr.Core;
using XcoAppSpaces.Contracts.Service;
using XcoAppSpaces.Contracts.Worker;

namespace test.XcoAppSpaces.Security.Basic.Helpers
{
	class WorkerRegistryMock : IXcoWorkerRegistry
	{
		public void FireWorkerAdded(IPort worker, List<XcoServiceAttributeInfo> workerAttributes, PublishMode published)
		{
			if (WorkerAdded != null)
				WorkerAdded(this, new XcoWorkerInfo(worker, null, null, published, workerAttributes, null, false, null, null, "identifier"));
		}

		public void FireWorkerRemoved(IPort worker, PublishMode published)
		{
			if (WorkerRemoved != null)
				WorkerRemoved(this, new XcoWorkerInfo(worker, null, null, published, null, null, false, null, null, "identifier"));
		}

		#region IXcoWorkerRegistry Members

		public bool Exists(Type contractType, string name, bool onlyPublished, bool connectionRequest)
		{
			throw new NotImplementedException();
		}

		public void Register<TContract>(TContract instance, string name) where TContract : Microsoft.Ccr.Core.IPort
		{
			throw new NotImplementedException();
		}

		public TMessageContract Resolve<TMessageContract>(string name)
		{
			throw new NotImplementedException();
		}

		public XcoWorkerInfo Resolve(Type contractType, string name, bool onlyPublished)
		{
			throw new NotImplementedException();
		}

		public event WorkerEventHandler WorkerAdded;

		public event WorkerEventHandler WorkerRemoved;

		#endregion

		#region IXcoService Members

		public void Initialize(global::XcoAppSpaces.Contracts.Service.IXcoServiceRegistry serviceRegistry)
		{
			throw new NotImplementedException();
		}

		#endregion

		public bool Exists(string workerIdentifier, bool onlyPublished, bool connectionRequest)
		{
			throw new NotImplementedException();
		}

		public string GenerateIdentifier(Type workerType, string workerName)
		{
			throw new NotImplementedException();
		}

		public XcoWorkerInfo Resolve(string workerIdentifier, bool onlyPublished)
		{
			throw new NotImplementedException();
		}
	}
}
